﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using WFNetLib.StringFunc;
using WFNetLib;
using DAL;

namespace 服务器端.webAPI
{
    public partial class Set_fujianqingdan : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id, fujianqingdan;
            RegResult ret = new RegResult();
            try
            {
                id = Request.QueryString["ID"];
                fujianqingdan = Request.QueryString["fujianqingdan"];
                //信息|用户id|实验id，实验名，实验室;
                if (string.IsNullOrEmpty(id))//没有这两个变量
                {
                    ret.endcodeID = "";
                    ret.message = "no id";
                }
                else
                {
                    byte[] bid = StringsFunction.strToHexByte(id, "");
                    lcyHashCal lcy = new lcyHashCal();
                    ret.endcodeID = StringsFunction.byteToHexStr(lcy.HashCal(bid, 5), "");
                    TEInfoDataDBOption.Set_fujianqingdan(ret.endcodeID, int.Parse(fujianqingdan));
                    ret.message = "ok";
                }
            }
            catch (System.Exception ex)
            {
                ret.endcodeID = "";
                ret.message = "未知错误" + ex.Message;
            }
            Response.Write(WFJSON.JsonSerializerBySingleData<RegResult>(ret));
        }
    }
}